package com.zyf.article.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zyf.article.pojo.Article;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

@Mapper
@Repository
public interface ArticleDao extends BaseMapper<Article> {
    /**
     * 审核
//     * @param id
     */
   @Update("update tb_article set state=#{state} where id=#{id}")
    public void examine(@Param("state") String state,@Param("id") String id);
    /**
     * 点赞
     * @param id
     * @return
     */
    @Update("update tb_article set thumbup=thumbup+1 where id=#{id}")
    public int updateThumbup(String id);
}
